package com.java.demo.controller;

import com.java.demo.enity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
    @Autowired
    private User user;
    public void printUser(){
        System.out.println(user);
        //修改
        User myUser=user;
        myUser.setName("王五");
        System.out.println("myUser——>"+myUser);
        System.out.println("user——>"+user);
    }
}
